home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / dev / e / dclistview.lha / dclistview.doc < prev    next >
Text File  |  1997-08-19  |  4KB  |  85 lines

  1. DCListview PLUGIN
  2. -----------------
  3.  
  4.     This plugin creates a GadTools Listview gadget, almost identical to the
  5. standard EasyGUI one, except that it will also report double-clicks on list
  6. items.  (Be sure to set the 'isgt' field of the PLUGIN gadget to 'TRUE', since
  7. this uses a GadTools gadget)
  8.  
  9. Constructors:
  10.  
  11.     dclistview(label=NIL,relx=0,rely=0,execlist=NIL,
  12.                current=0,key=NIL,disabled=FALSE)
  13.  
  14.     where:
  15.         label     -> the label for the gadget
  16.         relx,rely -> the usual relative gadget width/height (both default to 5)
  17.         execlist  -> the list to be displayed in the gadget
  18.         current   -> the list item to be placed at the top of the listview.
  19.                      This item will also be displayed beneath the listview
  20.                      under v37 or with a highlight bar under v39.  This value
  21.                      will always be updated when the user selects a list item.
  22.                   ** NOTE: If you don't want ANY list item highlighted
  23.                      initally, set current=-1.
  24.                   ** ALSO NOTE: Item highlighting is always set for this plugin
  25.                      gadget.  This makes the most sense when using double-click
  26.                      sensing.  Of course, this can always be changed... :)
  27.         key       -> keyboard shortcut ("a".."z","A".."Z").  Include a "_" in
  28.                      the label string to indicate this visually.
  29.         disabled  -> whether this gadget is disabled (v39+)
  30.  
  31. Destructor:
  32.  
  33.     END *must* be called for each NEWed object.
  34.  
  35. Data (should be considered read-only):
  36.  
  37.     OBJECT dclistview OF plugin
  38.       disabled    -> disabled or enabled
  39.       current     -> the currently selected item
  40.       clicked     -> TRUE if an item has just been double-clicked
  41.     PRIVATE ...
  42.     ENDOBJECT
  43.  
  44. New methods:
  45.  
  46.     setdclist(list)            -> change the list attached to the gadget;
  47.     getdclist()                -> returns the list attached to the gadget;
  48.     setdctop(top)              -> change which item is at the top;
  49.     setdccurrent(current)      -> change which item is selected.  Can also be
  50.                                   set to -1 to have no item selected.  This
  51.                                   function returns the actual 'current' value,
  52.                                   useful if you specify a 'current' that's out
  53.                                   range.
  54.     setdisabled(disabled=TRUE) -> disable/enable the gadget.
  55.  
  56. Action functions:
  57.  
  58.     Your action function will be called (or your action value returned by
  59.     easyguiA()) in the following circumstances:
  60.         - when an item is selected with the mouse, and again on a double click
  61.             NOTE: if you use an action value instead of an action function, you
  62.             obviously won't hear about double clicks since your GUI will
  63.             have closed :) ;
  64.         - when the assigned key is pressed, alone or shifted.
  65.  
  66. Exceptions:
  67.  
  68.     "dclv" will be raised by gtrender() if the gadget can't be created.
  69.  
  70. Other notes:
  71.  
  72.     1) The CONST DCLIST (which =PLUGIN) is available to be used in your EasyGUI
  73. gadget list, e.g., [DCLIST, {listaction}, dclist, TRUE].  This can make plugins
  74. in gadget lists easier to identify, especially if you use a lot of different
  75. Plugins.
  76.     2) The value of the 'current' field will NOT change if the user does not
  77. manipulate the listview in any way.  If you set 'current' to -1 at any point,
  78. be prepared to properly handle -1 as a returned value when you read the
  79. 'current' field.
  80.     3) Disabling of listviews under v39+ is minimal at best.  While the main
  81. list gadget is disabled, the prop gadget will still scroll the list.
  82.     4) I replaced a v39+ function that inadvertently crept into the code
  83. (twice!).  I should read the autodocs more closely. :)
  84.  
  85.